﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Windows.Forms;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Nmo;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Trace;
using Entity;

namespace DataControls
{
    public class LUONGGD_Data
    {
        DataBaseAccess dataBaseAccess = new DataBaseAccess();

        public Boolean kiemtra_MaLuongGD(String maluonggd)
        {
            int i = 0;
            String excuteString = "SELECT COUNT(*) FROM BANGLUONGGD WHERE MALUONGGD='" + maluonggd + "'";
            i = dataBaseAccess.Test(excuteString);
            if (i > 0)
                return true;
            else
                return false;
        }

        public Boolean kiemtra_GiaoVien(LUONGGD luonggd)
        {
            int i = 0;
            String excuteString = "SELECT COUNT(*) FROM BANGLUONGGD WHERE MAGV='" + luonggd.magv +
                                                        "' AND HOCKI =" + luonggd.hocki +
                                                        " AND NAMHOC=" + luonggd.namhoc + "";
            i = dataBaseAccess.Test(excuteString);
            if (i > 0)
                return true;
            else
                return false;
        }
    }
}
